<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			function login(){
				var _uname=uname.value;
				var _upwd=upwd.value;
				console.log(_uname);
				if(!_uname){alert("用户名不能为空");return;}
				var xhr=new XMLHttpRequest();
			xhr.onreadystatechange=function(){
				if(xhr.readyState==4&&xhr.status==200){
					var r=xhr.responseText;
					if(r==1){
						alert("登陆成功");
			//js跳转页面的写法
			 // location.herf=""
					}else{
						alert("登录失败");
					}
				}
			}
			xhr.open("get",`/pro/v1/login/${_uname}&${_upwd}`,true)
			xhr.send();
			}
		</script>
	</head>
	<body>
		<input type="text" id="uname"><br>
		<input type="text" id="upwd"><br>
		<button onclick="login()">显示</button>

	</body>
</html>
